package cn.tedu.ivos2.user.pojo.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

@Data
public class UserSaveParam {
    @Schema(description = "用户编号")
    private Long id;
    @Schema(description = "用户名", required = true)
    @NotBlank(message = "用户名不能为空")
    private String username;
    @Schema(description = "邮箱", required = true)
    @NotBlank(message = "邮箱不能为空")
    @Email(message = "邮箱格式错误")
    private String email;
    @Schema(description = "手机号", required = true)
    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    private String phone; //手机号
    @Schema(description = "年龄", required = true)
    @NotNull(message = "年龄不能为空")
    @Range(min = 0, max = 200, message = "年龄必须在0-200之间")
    private Integer age; //年龄
    @Schema(description = "性别", required = true)
    @NotBlank(message = "性别不能为空")
    private String gender; //性别
    @Schema(description = "状态", required = true)
    @NotBlank(message = "状态不能为空")
    private String status; //用户状态 0-禁用 1-启用
    @Schema(description = "职级", required = true)
    @NotBlank(message = "职级不能为空")
    private String level;//职级 10-员工 20-经理 30-总监 40-总裁
    @Schema(description = "直属领导编号")
//    @NotNull(message = "直属领导不能为空")
    private Long parentId; //直属领导编号
}
